﻿<%@ Page Title="Requisition Received Log" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="ReceivedLog.aspx.cs" Inherits="KorleBu.ReceivedLog" %>

<%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        #maincontentplaceholder_UpdatePanel
        {
            background-color:White;
        }
    </style>
    <script type="text/javascript">
        function CEO_NewWindow() {
            var receipt = window.open('Requisition_Receipt.aspx', '_blank', 'width=760,height=900,resizable=1,scrollbars=1');
            receipt.focus();
        }
    </script>
</asp:Content>
<%--<asp:Content ID="Content2" ContentPlaceHolderID="errorContentPlaceholder" runat="server">
</asp:Content>--%>
<asp:Content ID="Content3" ContentPlaceHolderID="sidebarcontentplaceholder" runat="server">
    <p>
        <br />
        <asp:Label ID="lblLoggedInUser" runat="server" Font-Bold="true" Visible="true"/>
    </p>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="maincontentplaceholder" runat="server">
    <asp:ScriptManager ID="ScriptManager" runat="server"></asp:ScriptManager> 
    <asp:UpdatePanel ID="UpdatePanel" runat="server">
        
        <ContentTemplate>
            <div id="ebar">
                <asp:Label runat="server" ID="lblMasterError" CssClass="errorLabel" />
            </div>
            <asp:TabContainer ID="TabContainer" runat="server" AutoPostBack="true" 
                Width="700px" ActiveTabIndex="0">
                <asp:TabPanel ID="ReceivedAdviceLog" runat="server" HeaderText="Received Advice Log">
                    <HeaderTemplate>Received Advice Log</HeaderTemplate>
                    <ContentTemplate>
                        <fieldset style="width: 573px; min-height: 50px;">
                            <asp:Label ID="lblStore" Style="font-weight:bold; margin-right: 20px; margin-left: 20px" runat="server">Store:</asp:Label>                            
                            <%--<asp:TextBox ID="txtStore" CssClass="txtboxWidth" runat="server" Style="margin-right: 50px; margin-left: 0px" MaxLength="20" Width="100"></asp:TextBox>--%>
                            <asp:Label ID="lblStoreDisplay" Style="margin-right: 50px; margin-left: 0px" runat="server"></asp:Label>
                            <%--<asp:Label ID="lblDate" Style="margin-right: 20px; margin-left: 20px" runat="server">Date:</asp:Label>
                            <asp:TextBox ID="txtDate" CssClass="txtboxWidth" runat="server" Style="margin-right: 50px; margin-left: 0px" MaxLength="20" Width="100"></asp:TextBox>--%>
                        </fieldset>
                        <fieldset style="width: 573px; min-height: 100px;">
                            <table style="margin-left:20px;">
                                <tr>
                                    <td colspan="2">
                                        <strong><asp:Label ID="LabelDescriptionOfOrder" runat="server">Description of Order</asp:Label></strong>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <strong><asp:Label ID="LabelLPONo" runat="server">LPO No:</asp:Label></strong>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtLPONo" CssClass="txtboxWidth" runat="server" MaxLength="20" Width="100"></asp:TextBox>
                                        <asp:RequiredFieldValidator runat="server" ID="rfvLPONo" ControlToValidate="txtLPONo" ForeColor="Red" ErrorMessage="*"
                                            Display="Dynamic" ValidationGroup="fillRequisition">
                                        </asp:RequiredFieldValidator>
                                        <asp:CompareValidator runat="server" ID="cvLPONo" ControlToValidate="txtLPONo" Type="Integer" ValidationGroup="fillRequisition"
                                            Display="Dynamic" ErrorMessage="LPO must be a valid number." ForeColor="Red" Operator="DataTypeCheck"></asp:CompareValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <strong><asp:Label ID="lblVendor" runat="server">Vendor:</asp:Label></strong>
                                    </td>
                                    <td>
                                        <asp:DropDownList runat="server" ID="ddlSelectVendor">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <strong><asp:Label ID="lblOfficer" runat="server" Text="Officer Receiving:"></asp:Label></strong>
                                    </td>
                                    <td>
                                        <asp:TextBox runat="server" ID="txtOfficer" MaxLength="20" Width="100"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                            
                            <%--<asp:Label ID="LabelDeliveryPerformance" runat="server">Delivery Performance</asp:Label>--%>
                            <%--<asp:Label ID="LabelRLFull" Style="margin-right: 5px;" runat="server">Full:</asp:Label>
                            <asp:CheckBox ID="CheckBoxRLFull" runat="server" />--%>
                            <%--<asp:Label ID="LabelRLSupplier" Style="margin-right: 4px; margin-left: 20px" runat="server">Supplier:</asp:Label>
                            <asp:Label ID="lblRLSupplier" CssClass="txtboxWidth" runat="server" Style="margin-right: 50px;" MaxLength="20" Width="100"></asp:Label>--%>
                            <%--<asp:Label ID="lblSRADescription" Style="margin-right: 5px; margin-left: 240px;" runat="server">If part delivery / Performance: SRA No</asp:Label>
                            <br />--%>
                            <%--<asp:Label ID="LabelRLSupplierAddress" Style="margin-right: 3px; margin-left: 20px" runat="server">Address:</asp:Label>
                            <asp:Label ID="lblRLSupplierAddress" CssClass="txtboxWidth" runat="server" Style="margin-right: 50px;" MaxLength="20" Width="100"></asp:Label>--%>
                            <%--<br />
                            <asp:Label ID="lblSRA1" Style="margin-right: 5px; margin-left: 244px;" runat="server">1.</asp:Label>
                            <asp:TextBox ID="txtSRA1" CssClass="txtboxWidth" runat="server" Style="margin-right: 5px; margin-left: 0px" MaxLength="20" Width="100"></asp:TextBox>
                            <asp:Label ID="lblSRA2" Style="margin-right: 5px;" runat="server">2.</asp:Label>
                            <asp:TextBox ID="txtSRA2" CssClass="txtboxWidth" runat="server" Style="margin-right: 5px; margin-left: 0px" MaxLength="20" Width="100"></asp:TextBox>
                            <br />
                            <asp:Label ID="lblSRA3" Style="margin-right: 5px; margin-left: 244px;" runat="server">3.</asp:Label>
                            <asp:TextBox ID="txtSRA3" CssClass="txtboxWidth" runat="server" Style="margin-right: 5px; margin-left: 0px" MaxLength="20" Width="100"></asp:TextBox>
                            <asp:Label ID="lblSRA4" Style="margin-right: 5px;" runat="server">4.</asp:Label>
                            <asp:TextBox ID="txtSRA4" CssClass="txtboxWidth" runat="server" Style="margin-right: 5px; margin-left: 0px" MaxLength="20" Width="100"></asp:TextBox>
                            <br />--%>
                        </fieldset>
                        <fieldset style="width: 573px; min-height: 176px;">
                            <br />
                            <asp:GridView ID="gvRequisition" runat="server" AutoGenerateColumns="False" onrowcommand="gvRequisition_RowCommand">
                                <Columns>
                                    <%--<asp:BoundField DataField="ItemID" HeaderText="No." />
                                            <asp:BoundField DataField="ItemName" HeaderText="Name" />--%>
                                            <asp:TemplateField HeaderText="Item Name">
                                                <ItemTemplate>
                                                    <asp:Label runat="server" ID="lblItemID" Visible="false" Text='<%# Eval("ItemID") %>'></asp:Label>
                                                    <asp:Label runat="server" ID="lblItemName" Text='<%# Eval("ItemName") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                    <asp:BoundField DataField="RequisitionQty" HeaderText="Qty. Ordered">
                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="ReceivedQty" HeaderText="Qty. Received" />
                                    <asp:TemplateField ConvertEmptyStringToNull="False">
                                        <EditItemTemplate>
                                            <asp:DynamicControl ID="DynamicControl1" runat="server" DataField="" Mode="Edit" />
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtFill" runat="server" Height="23px" Width="37px"></asp:TextBox>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <%--<asp:ButtonField ButtonType="Button" CommandName="Fill" Text="Fill" ValidationGroup="fillRequisition" />--%>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:Button runat="server" CommandName="Fill" ID="btnFill" Text="Fill" ValidationGroup="fillRequisition"
                                                Enabled='<%# ShouldFill(Eval("RequisitionQty"), Eval("ReceivedQty")) %>' />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>    
                            <br />
                        </fieldset>
                        <br />
                        <%--<fieldset style="width: 573px; min-height: 100px;">
                            <legend>Signature</legend>
                            <table style="width:100%;">
                                <tr>
                                    <td class="style4">
                                        <asp:Label ID="lblOfficerSig" runat="server" Text="Officer In Charge:"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblOfficerSigned" runat="server"></asp:Label>
                                        <asp:TextBox ID="txtOfficerSig" CssClass="txtboxWidth" runat="server" Style="margin-right: 50px; margin-left: 0px" MaxLength="20" Width="100"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style4">
                                        <asp:Label ID="lblStoreSig" runat="server" Text="Store Keeper:"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblStoreSigned" runat="server"></asp:Label>
                                        <asp:TextBox ID="txtStoreSig" CssClass="txtboxWidth" runat="server" Style="margin-right: 50px; margin-left: 0px" MaxLength="20" Width="100"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style4">
                                        <asp:Label ID="lblAuditSig" runat="server" Text="Internal Audit:"></asp:Label>
                                    </td>
                                    <td>
                                        <asp:Label ID="lblAuditSigned" runat="server"></asp:Label>
                                        <asp:TextBox ID="txtAuditSig" CssClass="txtboxWidth" runat="server" Style="margin-right: 50px; margin-left: 0px" MaxLength="20" Width="100"></asp:TextBox>
                                    </td>
                                </tr>
                            </table>
                         </fieldset>
                         <br />--%>
                         <br />
                            <asp:Button ID="btnSubmit" runat="server" onclick="btnSubmit_Click" Text="Close Requisition" />
                            &nbsp;&nbsp;&nbsp;
                            <asp:Button runat="server" ID="btnReturn" Text="Return to Store Administration" OnClick="btnReturn_Click" />
                            &nbsp;&nbsp;&nbsp;
                            <input type="button" onclick="CEO_NewWindow();"
                                value="Generate Receipt" runat="server"
                                id="btnCEOReceipt" />
                         <br />
                </ContentTemplate>
            </asp:TabPanel>
            <%--<asp:TabPanel ID="ReceiptVoucher" runat="server" HeaderText="Receipt Voucher">
                <HeaderTemplate>Receipt Voucher</HeaderTemplate>
                <ContentTemplate>
                    <fieldset style="width: 573px; min-height: 100px;">
                            <asp:Label ID="Label8" Style="font-weight:bold; margin-right: 4px; margin-left: 20px" runat="server">Supplier:</asp:Label>

                            <asp:Label ID="lblRLSupplier2" CssClass="txtboxWidth" runat="server" Style="margin-right: 50px;" MaxLength="20" Width="100"></asp:Label>
                            <br />
                            <asp:Label ID="Label11" Style="font-weight:bold; margin-right: 3px; margin-left: 20px" runat="server">Address:</asp:Label>
                            <asp:Label ID="lblRLSupplierAddress2" CssClass="txtboxWidth" runat="server" Style="margin-right: 50px;" MaxLength="20" Width="100"></asp:Label>
                            <br />
                        </fieldset>
                        <fieldset style="width: 573px; min-height: 176px;">
                            <br />
                            <asp:GridView ID="gvReceiptVoucher" runat="server" AutoGenerateColumns="False">
                                <RowStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                                <Columns>
                                    <asp:BoundField DataField="ItemID" HeaderText="No." />
                                    <%--<asp:TemplateField HeaderText="FOLIO">
                                        <ItemTemplate>
                                            <asp:Label ID="FOLIO" runat="server"/>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="ItemName" HeaderText="Name" />
                                    <asp:BoundField DataField="QtyReceived" HeaderText="Qty." />
                                    <asp:TemplateField HeaderText="Vendor Rate<br />GH¢">
                                        <ItemTemplate>
                                            <asp:Label runat="server" ID="lblVendorCost" Text='<%# String.Format("{0:0.00}", Eval("VendorCost")) %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Total Amount<br />GH¢">
                                        <ItemTemplate>
                                            <asp:Label runat="server" ID="lblTotalCost" Text='<%# String.Format("{0:0.00}", CalcCost(Eval("VendorCost"), Eval("QtyReceived"))) %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>    
                        </fieldset>
                </ContentTemplate>
                </asp:TabPanel>--%>
            </asp:TabContainer>
        </ContentTemplate>

    </asp:UpdatePanel>
</asp:Content>
